<?php
/**
 *  Pictures.php Created by : PhpStorm
 *
 * @author: 魏巍 <524314430@qq.com>
 * @date  : 2021/9/22 17:09
 */

namespace app\api\controller;

use think\App;

class SelectBox extends Base
{

    public function group()
    {
        $data = [
            [
                'id' => 1,
                'title' => '娱乐分公司',
            ],
            [
                'id' => 2,
                'title' => '物流分公司',
            ],
        ];
        $this->success($data);
    }

    public function group_member($data_id = 1)
    {
        $data = [
            1 => [
                [
                    'id' => 1,
                    'title' => '娱乐产品研发部',
                    'spread' => true,
                    'children' => [
                        [
                            'id' => 5,
                            'title' => '娱乐产品研发1组',
                            'checked'=> true
                        ],
                        [
                            'id' => 6,
                            'title' => '娱乐产品研发2组',
                        ],
                        [
                            'id' => 7,
                            'title' => '娱乐产品研发3组',
                        ]
                    ],
                ],
                [
                    'id' => 2,
                    'title' => '娱乐产品开发部',
                    'spread' => true,
                    'children' => [
                        [
                            'id' => 8,
                            'title' => '娱乐产品开发1组',
                        ],
                        [
                            'id' => 9,
                            'title' => '娱乐产品开发2组',
                        ],
                        [
                            'id' => 10,
                            'title' => '娱乐产品开发3组',
                        ]
                    ]
                ]
            ],
            2 => [
                [
                    'id' => 3,
                    'title' => '物流产品开发部',
                    'spread' => true,
                    'children' => [
                        [
                            'id' => 11,
                            'title' => '物流产品开发1组',
                            'checked'=> true
                        ],
                        [
                            'id' => 12,
                            'title' => '物流产品开发2组',
                        ],
                        [
                            'id' => 13,
                            'title' => '物流产品开发3组',
                        ]
                    ],
                ],
                [
                    'id' => 4,
                    'title' => '物流产品开发部',
                    'spread' => true,
                    'children' => [
                        [
                            'id' => 14,
                            'title' => '物流产品开发1组',
                        ],
                        [
                            'id' => 15,
                            'title' => '物流产品开发2组',
                        ],
                        [
                            'id' => 16,
                            'title' => '物流产品开发3组',
                        ]
                    ]
                ]
            ],
        ];
        $this->success($data[$data_id]);
    }


    public function memberList($data_id=0)
    {
        $data = [
            [
                'id'=> 1,
                'title'=> '张三'
            ],
            [
                'id'=> 2,
                'title'=> '李四'
            ],
            [
                'id'=> 3,
                'title'=> '王五'
            ],
            [
                'id'=> 4,
                'title'=> '麻三'
            ],
        ];
        $this->success($data);
    }
}
